using System;
using InfoTech.Mvc.Core.Models;
using InfoTech.Utilities.Reflection;
using System.ComponentModel.DataAnnotations;
using InfoTech.Mvc.Core.UI.Validation;
using InfoTech.LanTranh.MucVu.Bussiness;

namespace InfoTech.Mvc.LanTranh.MucVu.Models
{
	[Serializable]
	public partial class XAPHUONGModel : ObjModel<XAPHUONG>, IModelConverter
	{

		#region Constructor

		public XAPHUONGModel()
			: base()
		{
		}

		public XAPHUONGModel(XAPHUONG obj)
			: base(obj)
		{
		}

		#endregion

		#region Fields

		private System.Guid? _maxaphuong;

		private System.Guid? _maquanhuyen;

		private System.String _tenxaphuong;

		private System.Boolean _isdata;

		private System.Boolean _isdefault;

		#endregion

		#region Properties

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Guid? MAXAPHUONG
		{
			get
			{
				return _maxaphuong;
			}
			set
			{
				_maxaphuong = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Guid? MAQUANHUYEN
		{
			get
			{
				return _maquanhuyen;
			}
			set
			{
				_maquanhuyen = value;
			}
		}

		//[Store]
        [Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		[StringLength(1000, ErrorMessage= "Value must be under 1000 characters")]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.String TENXAPHUONG
		{
			get
			{
				return _tenxaphuong;
			}
			set
			{
				_tenxaphuong = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Boolean ISDATA
		{
			get
			{
				return _isdata;
			}
			set
			{
				_isdata = value;
			}
		}

		//[Store]
		//[Required(ErrorMessage = "Value is required")]
		//[Range(0, 0, ErrorMessage = "Value must be between 0 and 0")]
		//[StringLength(0)]
		//[EmailRegx]
		//[NumberRegx]
		//[RealNumberRegx]
		//[IntergerRegx]
		//[RealIntergerRegx]
		public System.Boolean ISDEFAULT
		{
			get
			{
				return _isdefault;
			}
			set
			{
				_isdefault = value;
			}
		}

		#endregion

		#region IModelConverter

		public System.Type Reflector()
		{
			return typeof(XAPHUONGModel);
		}
		public object GetModel()
		{
			return this;
		}

		#endregion

		#region Overrides of Model<XAPHUONG>

		public override void ReverttoModel()
		{
			CreateModel(this);
		}

		public override XAPHUONG ReverttoBussiness()
		{
			return CreateBussiness(this);
		}

		#endregion

		#region Operators

		public static implicit operator XAPHUONGModel(XAPHUONG obj)
		{
			return new XAPHUONGModel(obj);
		}
		public static implicit operator XAPHUONG(XAPHUONGModel obj)
		{
			return obj.ReverttoBussiness();
		}

		#endregion

	}
}
